package dotdashdot.bradz.trendsettr;

import android.app.Application;

public class ApplicationGlobalVars extends Application{
	private boolean client_set = false;
	private boolean credentials_set = false;
	private String global_buffer = "";
	//This is the network object. Expensive to create so it's here
	private ClassClientHolder httpclient;
	//This is the currently logged in user and their rank
	private ClassUserCredentials credentials;
  	
	public void set_buffer(String global_buffer){
		this.global_buffer = global_buffer;
	}
	
	public String get_buffer(){
		return global_buffer;
	}
	
    public boolean client_loaded(){
    	return client_set;
    }
    
    public void invalidate_credentials(){
    	credentials_set = false;
    }
    
    public boolean credentials_loaded(){
    	return credentials_set;
    }
    
    public void set_credentials_store(ClassUserCredentials credentials){
    	credentials_set = true;
    	this.credentials = credentials;
    }
    
    public ClassUserCredentials get_credentials_store(){
    	return credentials;
    }
    
    public void invalidate_client_store(){
    	client_set = false;
    }
    
    public void set_client_store(ClassClientHolder httpclient){
    	client_set = true;
    	this.httpclient = httpclient;
    }
    
    public ClassClientHolder get_client_store(){
    	return httpclient;
    }
}
